#include <stdio.h>
#include <sys/types.h>
#include <gmp.h>
#include <assert.h>

int main(int argc, char **argv) {
  mpz_t sum;

  mpz_init(sum);
  mpz_set_ui(sum, 0UL);

  mpz_t i;

  mpz_init(i);

  char *line = NULL;
  size_t len = 0;
  ssize_t bytes;

  while ((bytes = getline(&line, &len, stdin)) != -1) {
    char *start = line;
    while (*start == '0')
      start++;

    int valid = mpz_set_str(i, start, 10);
    assert(valid == 0);

    mpz_add(sum, sum, i);
  }

  mpz_out_str(stdout, 10, sum);
  printf("\n");

  return 0;
}
